﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Liang.Device.Camera.Dll
{
    static class DaHuaVMSDll
    {
        /// <summary>
        /// 初始化SDK
        /// </summary>
        /// <returns></returns>
        [DllImport("KsCamera_DaHuaVMS.dll")]
        public static extern int KsCamera_DaHuaVMS_Init();

        /// <summary>
        /// 注销SDK
        /// </summary>
        [DllImport("KsCamera_DaHuaVMS.dll")]
        public static extern void KsCamera_DaHuaVMS_Cleanup();

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="pchCamIP"></param>
        /// <param name="nPort"></param>
        /// <param name="pchUserName"></param>
        /// <param name="pchPassword"></param>
        /// <param name="bShowMsg"></param>
        /// <returns></returns>
        [DllImport("KsCamera_DaHuaVMS.dll")]
        public static extern int KsCamera_DaHuaVMS_Login(string pchCamIP, byte nPort, string pchUserName, string pchPassword, int bShowMsg);

        /// <summary>
        /// 注销
        /// </summary>
        /// <param name="nClient"></param>
        /// <returns></returns>
        [DllImport("KsCamera_DaHuaVMS.dll")]
        public static extern int KsCamera_DaHuaVMS_LogOut(int nClient);

        /// <summary>
        /// 实时播放
        /// </summary>
        /// <param name="nClient"></param>
        /// <param name="nChannel"></param>
        /// <param name="hPlayWnd"></param>
        /// <returns></returns>
        [DllImport("KsCamera_DaHuaVMS.dll")]
        public static extern int KsCamera_DaHuaVMS_RealPlay(int nClient, uint nChannel, IntPtr hPlayWnd);

        /// <summary>
        /// 停止播放
        /// </summary>
        /// <param name="nRealPlayID"></param>
        /// <returns></returns>
        [DllImport("KsCamera_DaHuaVMS.dll")]
        public static extern int KsCamera_DaHuaVMS_StopRealPlay(int nRealPlayID);

        /// <summary>
        /// 抓拍
        /// </summary>
        /// <param name="nRealPlayID"></param>
        /// <param name="pchPathName"></param>
        /// <returns></returns>
        [DllImport("KsCamera_DaHuaVMS.dll")]
        public static extern int KsCamera_DaHuaVMS_CaptureImage(int nRealPlayID, string pchPathName);
    }
}
